<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html>

<head>
    <title>意见反馈列表</title>
</head>

<body>

<div id="wrapper">
    <div class="gray-bg">
        <div class="row m-t-sm">
            <div class="col-lg-12">
                <ol class="breadcrumb f-fl">
                    <li>
                        <i class="fa fa-location-arrow"></i>  <a>意见反馈</a>
                    </li>
                    <li class="active">
                        <strong>意见反馈列表</strong>
                    </li>
                </ol>
            </div>
        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox">
                        <div class="ibox-content">
                            <div class="search-area">
                                <form role="form" class="form-inline" id="queryform">
                                    <label for="username">
                                        <input type="input" placeholder="用户名" name="username"
                                               id="username"
                                               class="form-control form-filter"></label>
                                    <label for="nickname">
                                        <input type="input" placeholder="昵称" name="nickname"
                                               id="nickname"
                                               class="form-control form-filter"></label>
                                    <label for="mobile">
                                        <input type="input" placeholder="手机号" name="mobile"
                                               id="mobile"
                                               class="form-control form-filter"></label>
                                    <label for="appCode">
                                        <select class="form-control form-filter" id="appCode" name="appCode">
                                            <option value="">角色</option>
                                            <option value="resident">会员</option>
                                            <option value="servant">服务者</option>
                                        </select>
                                    </label>
                                    <label for="platform">
                                        <select class="form-control form-filter" id="platform" name="platform">
                                            <option value="">来源</option>
                                            <option value="03">微信</option>
                                            <option value="04">Android</option>
                                            <option value="05">Ios</option>
                                        </select>
                                    </label>
                                    <button class="btn btn-primary" type="button" onclick="submitFilter()"> 查询</button>
                                    <button class="btn btn-primary" datatable-clear type="button" onclick="clean()"> 清除</button>
                                </form>
                            </div>
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover dataTables" id="data-table"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {
        var setting = {
            "ajax": {
                "url": "${ctx}/admin/sys/feedback/list",
                "type": "POST"
            },
            "columns": [
                {"title": "用户名", "data": "username", "width": "10%", "orderable": true},
                {"title": "昵称", "data": "nickname", "width": "10%", "orderable": true},
                {"title": "手机号", "data": "mobile", "width": "10%", "orderable": true},
                {"title": "反馈内容", "data": "content", "width": "30%", "orderable": true},
                {"title": "角色", "data": "appCode", "width": "10%", "orderable": true},
                {"title": "来源", "data": "platform", "width": "10%", "orderable": true},
                {"title": "反馈时间", "data": "createTime", "width": "20%", "orderable": true},
            ],
            "columnDefs": [
                {"targets": 4,
                    "render": function (data) {
                        if(data == "resident"){
                            return "会员";
                        }else if(data == "servant"){
                            return "服务者";
                        }else{
                            return data;
                        }
                    },
                    "orderable": true
                },
                {"targets": 5,
                    "render": function (data) {
                        if(data == 03){
                            return "微信";
                        }else if(data == 04){
                            return "Android";
                        }else if(data == 05){
                            return "Ios";
                        }else{
                            return data;
                        }
                    },
                    "orderable": true
                },
                {
                    "render": function (data, type, row, meta) {
                    },
                    "orderable": false
                }
            ],
            "order": [
                [6, "desc"]
            ]
        };
        /* Init DataTables */
        $('#data-table').DataTable(ehconfig.get_datatable_config(setting));
        submitFilter = function () {
            $('#data-table').DataTable().draw();
        }
    });
    function clean() {
        $('#username').val('');
        $('#nickname').val('');
        $('#mobile').val('');
        $('#appCode').val('');
        $('#platform').val('');
        $('#data-table').DataTable().draw();
    }


</script>

</body>

</html>
